package cate.game.role.farm.udgpalace;

import cate.common.table.d.GDFight;
import cate.game.play.proce.play.PlayPO;
import cate.game.role.Role;
import cate.game.role.farm.AbstractFarmFTC;
import cate.game.role.farm.udgpalace.msg.UdgPalaceChallengeResp;

public class UdgPalaceFTC extends AbstractFarmFTC<MyUdgPalace> {
    public int bossId;
    public boolean autoHandleEvent;
    public UdgPalaceFTC(Role role, int bossId, boolean autoHandleEvent) {
        setup(role);
        this.bossId = bossId;
        this.autoHandleEvent = autoHandleEvent;
    }

    @Override
    protected MyUdgPalace po(Role role) {
        return role.getFarm().udgPalace;
    }

    @Override
    public void handleResult(Role role, PlayPO play){
        super.handleResult(role, play);
        po(role).afterChallenge(this.bossId, play, autoHandleEvent);
        role.sendNow(new UdgPalaceChallengeResp(this.bossId, play.winner == GDFight.Team.A, play, autoHandleEvent));
    }
}
